<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/metro/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/common.js"/>"></script>
<script>
	$(document).ready(function() {
	});

	//添加信息按钮响应函数
	function addFood() {
		$('#AddForm').form('submit', {
			url : '<c:url value='/shop/updateShopRaise.do'/>', //查询提交路径
			onSubmit : function()//提交按钮相应函数
			{

				return $('#AddForm').form('validate');
			},
			success : function(data) {
				data = eval('(' + data + ')');
				if (data.success) {
					window.opener.window.tea();
					$.messager.alert('系统提示', '修改成功', 'info', function() {
						window.close();
					});
				} else {
					var message = "";
					if (data.msg == "msg001") {
						message = "已录入此种关系！请到主页面点击修改！";
					} else if (data.msg == "msg0002") {
						message = "此种材料已经录入该品质";
					}
					$.messager.alert("提示", message, 'warning');

				}
			},
			error : function() {
				$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
				return;
			}
		});

	}

	$(function() {
		// 下拉框选择控件，下拉框的内容是动态查询数据库信息  
		$('#materType').combobox({
			url : "<c:url value='/mater/pulldownMaterType.do?space=0'/>",
			editable : true, //不可编辑状态  
			cache : false,
			panelHeight : '150',
			valueField : 'materType',
			textField : 'materTypename',
			required : true,
		    value:'${shopRaisePriceVo.materType }'
		});
		// 下拉框选择控件，下拉框的内容是动态查询数据库信息  
		$('#supId').combobox({
			url : "<c:url value='/store/pulldownSupId.do?space=0'/>",
			editable : true, //不可编辑状态  
			cache : false,
			panelHeight : '150',
			valueField : 'supId',
			textField : 'supName',
			required : true,
			value: '${shopRaisePriceVo.supId }'
		});
	});
</script>
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<table width="90%" align="center">
		<tr></tr>
		<tr>
			<td>

				<div style="height: auto; background: #fafafa; padding: 5px;"
					class="easyui-panel" title="修改商店抬价信息" iconCls="icon-save"
					collapsible="true" minimizable="false" maximizable="false"
					closable="false">

					<form id="AddForm" name="AddForm" method="post">
						<table cellpadding="5">
							<tr>
                                <td>客户名称:</td>
                                <td><input class="easyui-validatebox" type="text" readOnly="true"
                                    name="shopName" required="true" validType="length[1,30]" value="${shopVo.shopName }" /></td>
                            </tr>
                            <tr>
                                <td>供货商:</td>
                                <td><input class="easyui-combobox" id="supId" name="supId" required="true" readOnly="true"/></td>
                            </tr>
							<tr>
								<td>种类:</td>
								<td><input class="easyui-combobox" name="materType" readOnly="true"
									id="materType" required="true"></td>
							</tr>
							<tr>
								<td>提价百分比:</td>
								<td><input class="easyui-numberbox" type="text"
									name="raiseAmount" required="true" validType="length[1,3]" value="${shopRaisePriceVo.raiseAmount }" />
								</td>
							</tr>

						</table>
						<a class="easyui-linkbutton" onclick="addFood()">修改</a>
						<input class="easyui-validatebox" type="hidden" name="shopId" required="true"  value="${shopVo.shopId }" />
					    <input class="easyui-validatebox" type="hidden" name="rpid" required="true"  value="${shopRaisePriceVo.rpid }" />
					
					</form>

				</div>
			</td>
		</tr>
	</table>
</body>
</html>